<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="fragments :: head(~{::title})">
    <meta charset="UTF-8">
    <title>Title</title>
</head>

<style>
    .text-border-radius{
        border-radius: 50px 50px 50px 50px !important;
    }

    .button-width{
        width: 200px;
    }

    .text-width{
        width: 200px !important;
    }

</style>

<body>

<nav th:fragment="menu(n)" class="navbar navbar-inverse lucency-sm rounded-no lucency-sm animated fadeIn">
    <div class="container">

        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">切换</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#" th:href="@{/}" ><b>创美网盘</b></a>
        </div>

        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1" style="overflow: visible !important;">
            <ul class="nav navbar-nav">

                <li><a th:href="@{/}" href="#"><span class="glyphicon glyphicon-home"></span> 首页</a></li>
                <li><a href="#" th:href="|@{/goDisk}?pagestart=1|"><sapn class="glyphicon glyphicon-tag"></sapn> 网盘</a></li>
                <li><a href="#" th:href="@{/dynamic/index}"><sapn class="glyphicon glyphicon-align-left"></sapn> 动态</a></li>
                <li><a href="#" th:href="@{/aboutus}"><span class="glyphicon glyphicon-list"></span> 关于我们</a></li>
                <li class="active"><a href="#"><span class="glyphicon glyphicon-bookmark"></span> 修改密码</a></li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                <!--<li><img id="avatar" src="http://www.blogry.cn/images/avatar.jpg" class="img-circle" width="40px" height="40px"></li>-->
                <li th:if="${user} == null"><a href="#" th:href="@{/loginIndex}"><sapn class="glyphicon glyphicon-user"></sapn> 登录</a></li>
                <!--<li><a href="#" th:href="@{/goDisk}"><sapn class="glyphicon glyphicon-bookmark"> 我的网盘</span></a></li>-->
                <li class="dropdown">
                    <a href="javascript:(0)" data-toggle="dropdown">
                        <img class="img-size-least img-circle" src="../sWtatic/images/avatar/avatar.jpg" th:src="${user.getAvatar()}">
                        <span th:text="${user.getNickname()}">hello</span>
                    </a>
                    <ul class="dropdown-menu" role="menu">
                        <li role="presentation" class="dropdown-header">登录操作</li>
                        <li><a href="#" th:href="@{/user/logout}"  role="menuitem"><span class="glyphicon glyphicon-remove"></span> 注销</a></li>
                        <!--分割线-->
                        <li class="divider"></li>
                        <li role="presentation" class="dropdown-header">用户操作</li>
                        <li><a href="#" th:href="@{/user/editor}" role="menuitem"><span class="glyphicon glyphicon-pencil"></span> 编辑信息</a></li>
                    </ul>
                </li>
                <!--<li class=""><a href="#"><span class="glyphicon glyphicon-pencil"></span> 修改</a></li>-->
            </ul>
        </div>
    </div>
</nav>

<br>
<br>
<br>
<br>
<br>
<br>
<div class="container animated bounceInRight lucency-xs">

    <div class="row">
        <div class="col-md-12">
            <div class="panel panel-primary">
                <div class="panel-heading">
                    <h3>修改密码</h3>
                    <hr>
                </div>
                    <div class="panel-body">
                        <div class="col-md-8 col-md-offset-1">
                            <form action="#" th:action="@{/admin/ediPass}" role="form" method="post">
                                <div class="input-group">
                                    <label>原密码</label><br>
                                    <input type="password" class="form-control text-width  text-border-radius" name="originalPass" placeholder="请输入原密码...">
                                </div>
                                <br>
                                <div class="input-group">
                                    <label>新密码</label><br>
                                    <input type="password" class="form-control text-width text-border-radius" name="newPass" placeholder="请输入新密码...">
                                </div>
                                <br>
                                <div class="input-group">
                                    <label>验证信息</label><br>
                                    <input type="text" class="form-control text-width text-border-radius" name="question" placeholder="请输入验证信息...">
                                </div>
                                <br>
                                <div class="btn-group">
                                    <input type="submit" class="btn btn-success button-width" value="提交">
                                </div>
                            </form>
                        </div>

                </div>

            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-md-12">
            <div th:if="${errorMessage} != null">
                <div class="alert alert-danger">
                    <h4>错误:</h4>
                    <h5 th:text="${errorMessage}">输入信息错误!</h5>
                </div>
            </div>
        </div>
    </div>



</div>

<!--/*/<th:block th:replace="fragments :: script">/*/-->
<!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
<script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
<!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>
<!--加载bootstrap验证器-->
<script src="../static/bootstrap/js/bootstrapValidator.min.js" th:src="@{/bootstrap/js/bootstrapValidator.min.js}"></script>
<!--/*/</th:block>/*/-->

<script>
    $(function () {
        $('form').bootstrapValidator({

            message: '错误!!',
            feedbackIcons: {
                valid: 'glyphicon glyphicon-ok',
                invalid: 'glyphicon glyphicon-remove',
                validating: 'glyphicon glyphicon-refresh'
            },
            fields: {
                originalPass: {
                    validators: {
                        notEmpty: {
                            message: '原密码不能为空'
                        }
                    }
                },
                newPass: {
                    validators: {
                        notEmpty: {
                            message: '新密码不能为空'
                        }
                    }
                },
                question: {
                    validators: {
                        notEmpty: {
                            message: '验证信息不能为空'
                        }
                    }
                }
            }
        });
    });
</script>

</body>
</html>